home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / basic / PureBasic_Upd.lha / PureBasic_Update1.60 / PureBasic / Examples / Sources / File.pb < prev    next >
Encoding:
Text File  |  2000-09-10  |  763 b   |  42 lines

  1. ;
  2. ; ********************************
  3. ;
  4. ; File example file for Pure Basic
  5. ;
  6. ;  © 2000 - Fantaisie Software -
  7. ;
  8. ; ********************************
  9. ;
  10. ;
  11.  
  12. InitFile(0)
  13.  
  14. If CreateFile(0,"ram:PureBasic.test")      ; Create a file and put some text in it.
  15.                                            ;
  16.   WriteStringN("Hello I'm Pure Basic")      ;
  17.   WriteStringN("What do you think of me ?") ;
  18.  
  19.   WriteLong(120000)
  20.   WriteWord(-1500)
  21.   WriteByte(-10)
  22.              
  23.   CloseFile(0)
  24. Endif
  25.  
  26.  
  27. If ReadFile(0,"ram:PureBasic.test")
  28.  
  29.   PrintN("Displaying file 'Ram:PureBasic.test'")
  30.  
  31.   PrintN(ReadString())
  32.   PrintN(ReadString())
  33.  
  34.   PrintNumberN(ReadLong())
  35.   PrintNumberN(ReadWord())
  36.   PrintNumberN(ReadByte())
  37. Endif
  38.  
  39. MouseWait()
  40.  
  41. End   ; File is automagically closed at the end.
  42.